import request from '@/utils/request'

// 统一前缀
var prefix = '/recruitService'

//条件查询岗位
export function lookPost(post) {
  return request({
    url: `${prefix}/post/page`,
    method: 'POST',
    params: {
      current: post.current,
      size: post.size,
    },
    data: post,
  })
}

//添加一条岗位
export function insertOnePost(post) {
  return request({
    url: `${prefix}/post`,
    method: 'POST',
    data: post,
  })
}

//修改岗位
export function updateOnePost(post) {
  return request({
    url: `${prefix}/post`,
    method: 'PUT',
    data: post,
  })
}

//删除岗位
export function deletePost(ids) {
  return request({
    url: `${prefix}/post`,
    method: 'DELETE',
    data: ids,
  })
}

//岗位趋势分析
export function statisticsPostTrend() {
  return request({
    url: `${prefix}/postChats/trend`,
    method: 'GET',
  })
}

//岗位数量分析
export function sumStatisticsPost() {
  return request({
    url: `${prefix}/postChats/sum`,
    method: 'GET',
  })
}
//岗位分布
export function postStatisticsDistrict() {
  return request({
    url: `${prefix}/postChats/pie`,
    method: 'GET',
  })
}
